package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import damain.Jobs;

public class JobDao {
	public void insert(Jobs jobs){
		String sql="insert into jobs values(?,?,?,?)";
		Connection con=Util.getConnection();
		try {
			PreparedStatement pstm=con.prepareStatement(sql);
			pstm.setString(1, jobs.getJob_id());
			pstm.setString(2, jobs.getJob_title());
			pstm.setInt(3, jobs.getMin_salary());
			pstm.setInt(4, jobs.getMax_salary());
			pstm.executeUpdate();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public void delete(String id){
		String sql="delete from jobs where job_id='"+id+"'";
		Connection con=Util.getConnection();
		try {
			PreparedStatement pstm=con.prepareStatement(sql);
			pstm.executeUpdate();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
